#include <Arduino.h>
#include "swspi.h"
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;

class ltc2496
{
public:
    void begin(YSPI *spi, const u8 *chan, u8 len, u16 zero);
    u16 read(u8 channel);

private:
    YSPI *spi;
    u8 index, last, nrs;
    const u8 *chan;
    u16 *value;
    float lastValue[16];
    u16 zero;
#ifdef USE_FREERTOS
    static void thread(const void *);
    void rtos_loop();
#endif
};